package top.soeasy.common.core.domain.model;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import top.soeasy.common.core.domain.entity.SysMember;

import java.util.Collection;

@Data
public class MiniLoginMember extends BaseLoginUser implements UserDetails {
    private SysMember member;

    private Long loginTime;

    private Long expireTime;

    private String token;

    public MiniLoginMember() {
    }
    public MiniLoginMember(SysMember member) {
        this.member = member;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return member.getPassword();
    }

    @Override
    public String getUsername() {
        return member.getUserName();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
